var xtCityWinAdd;
var xtCityFormAdd;
function addXtCity(xt_provinceID){
	initXtCityFormAdd();
	Ext.getCmp("xt_cityUpID").setValue(xt_provinceID);
	xtCityWinAdd = Ext.create('Ext.Window',{
		layout:'fit',
		width:800,
		height:400,
		maximizable:true,
		minimizable:true,
		animateTarget:document.body,
		plain:true,
		modal:true,
		title:'添加信息',
		listeners:{
			minimize:function(win,opts){
				if(!win.collapse()){
					win.collapse();
				}else{
					win.expand();
				}
			}
		},
		items:xtCityFormAdd,
		buttons:[{
			text:'保存',
			itemId:'save',
			handler:function(button){
				submitForm(xtCityFormAdd,'../xtCityController/addXtCity',grid,xtCityWinAdd,false,true);
			}
		},{
			text:'关闭',
			itemId:'close',
			handler:function(button){
				button.up('window').close();
			}
		}]
	});
	xtCityWinAdd.show();
}
function initXtCityFormAdd(){
	xtCityFormAdd = Ext.create('Ext.FormPanel',{
		xtype:'form',
		waitMsgTarget:true,
		defaultType:'textfield',
		autoScroll:true,
		fieldDefaults:{
			labelWidth:70,
			labelAlign:'left',
			flex:1,
			margin:'2 5 4 5'
		},
		items:[
		{
			fieldLabel:'市城名称',
			xtype:'textfield',
			name:'xt_cityName',
			maxLength:20,
			anchor:'40%'
		},
		{
			fieldLabel:'上级编号',
			xtype:'textfield',
			name:'xt_cityUpID',
			maxLength:20,
			hidden:true,
			id:'xt_cityUpID',
			anchor:'100%'
		},
		{
			fieldLabel:'',
			xtype:'numberfield',
			value:'0',
			hidden:true,
			name:'xt_cityUpIdNum',
			anchor:'100%'
		},
		{
			fieldLabel:'路&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;径',
			xtype:'textfield',
			name:'xt_cityPath',
			maxLength:100,
			anchor:'100%'
		},
		{
			fieldLabel:'类&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;型',
			xtype:'textfield',
			name:'xt_cityType',
			maxLength:20,
			anchor:'40%'
		},
		{
			fieldLabel:'',
			xtype:'numberfield',
			value:'0',
			hidden:true,
			name:'xt_cityTypeNum',
			anchor:'100%'
		},
		{
			fieldLabel:'简&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称',
			xtype:'textfield',
			name:'xt_cityShortName',
			maxLength:11,
			anchor:'40%'
		},
		{
			fieldLabel:'拼&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;音',
			xtype:'textfield',
			name:'xt_citySpell',
			maxLength:11,
			anchor:'40%'
		},
		{
			fieldLabel:'',
			xtype:'textfield',
			name:'xt_cityAreaID',
			maxLength:11,
			hidden:true,
			anchor:'100%'
		},
		{
			fieldLabel:'邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;编',
			xtype:'textfield',
			name:'xt_cityPostCode',
			maxLength:11,
			anchor:'40%'
		}
		]
	});
}
